CREATE TABLE VPI.EXTRACT_BATCH
(
	BATCH_ID	NUMBER(9)		NOT NULL,
	SERVICE_ID	VARCHAR2(32)	NOT NULL,

	VAR$DATE1	DATE,
	VAR$NUM1	NUMBER,
	VAR$STR1	VARCHAR2(64),
	VAR$STR2	VARCHAR2(64),
	VAR$STR3	VARCHAR2(64),
	VAR$STR4	VARCHAR2(64),
	VAR$STR5	VARCHAR2(64),
	VAR$STR6	VARCHAR2(64),
	VAR$STR7	VARCHAR2(64),
	VAR$STR8	VARCHAR2(64),
	VAR$STR9	VARCHAR2(4000),

	CONSTRAINT PK_EXTRACT_BATCH PRIMARY KEY (BATCH_ID),
	CONSTRAINT FK_EXTRACT_BATCH FOREIGN KEY (SERVICE_ID) REFERENCES VPI.EXTRACT_SERVICE (SERVICE_ID)
);

CREATE INDEX VPI.IX_EXTRACT_BATCH_APP ON VPI.EXTRACT_BATCH (SERVICE_ID);

COMMENT ON TABLE VPI.EXTRACT_BATCH
	IS 'This table contains the session context of each batch. Runtime variables can be stored in here.';

COMMENT ON COLUMN VPI.EXTRACT_BATCH.BATCH_ID
	IS 'The unique Id for each batch session.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.SERVICE_ID
	IS 'Categorize batches for investigating convenience.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$DATE1
	IS 'A date type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$NUM1
	IS 'A number type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR1
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR2
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR3
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR4
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR5
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR6
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR7
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR8
	IS 'A string type variable.';
COMMENT ON COLUMN VPI.EXTRACT_BATCH.VAR$STR9
	IS 'A text type variable.';
